Skip to main content

touchStart

Type

message

Summary

Sent when a user touches a control in a mobile application

Syntax

touchStart <pTouchID>

Description

Handle the touchStart message to perform an action when the user touches the screen, before the touch is released.

The touchStart message is sent to the control that was touched, or to the card if no control was under the touch point.

The pTouchID parameter is a number which uniquely identifies a sequence of touch messages corresponding to an individual, physical touch action. All such sequences start with a touchStart message, have one or more touchMove messages and finish with either a touchEnd or a touchRelease message.

No two touch sequences will have the same pTouchID, and it is possible to have multiple (interleaving) such sequences occurring at once. This allows handling of more than one physical touch at once and, for example, allows you to track two fingers moving on the iPhone's screen.

The sequence of touch messages is tied to the control in which the touch started, in much the same way mouse messages are tied to the object a mouse down starts in. The test used to determine what object a touch starts in is identical to that used to determine whether the pointer is inside a control. In particular, invisible and disabled controls are not considered viable candidates.

Parameters

NameTypeDescription

pTouchID

A number which uniquely identifies a sequence of touch messages corresponding to an individual, physical touch action

Examples

on touchStart tID -- show popup menu when the control is touched
popup button "Configure"
end touchStart

message: touchMove, touchRelease, touchEnd

Compatibility and Support

Introduced

LiveCode 4.5.2

OS

ios

android

Platforms

mobile

Thank you for your feedback!

Was this page helpful?